<!--
<template>
    <div>
        <el-table :data="showCreditList"  >
            <el-table-column
                    prop="creditNo"
                    label="债权人编号"
                    width="160px">
            </el-table-column>
            <el-table-column
                    prop="typeText"
                    width="120px"
                    label="债权人姓名"
                    align="left">
            </el-table-column>
            <el-table-column
                    align="right"
                    label="操作"
                    width="80px">
                <template slot-scope="scope">
                    <el-button @click="toMain" type="text" size="small" >查 看
                    </el-button>

                </template>
            </el-table-column>
        </el-table>



        <el-dialog title="" :visible.sync="registerVisible" width="95%" center>
            <el-form ref="form" :model="form" :label-width="formLabelWidth">
                <el-form-item label="债权人身份: ">
                    <el-select v-model="form.nature" placeholder="请选择">
                        <el-option
                                v-for="nature in creditType"
                                :key="nature.value"
                                :label="nature.value"
                                :value="nature.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="是否代理人: ">
                    <el-radio-group v-model="form.agentType">
                        <el-radio label="是"></el-radio>
                        <el-radio label="否" style="margin-left: 20px"></el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="是否参加债权人大会: ">
                    <el-select v-model="form.attendState" placeholder="请选择">
                        <el-option
                                v-for="state in attendStateList"
                                :key="state.value"
                                :label="state.value"
                                :value="state.value">
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="registerVisible = false">取消</el-button>
                <el-button @click="toRegister" type="primary">确定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
    import util from 'assets/js/util.js'

    export default {
        data() {
            return {
                showCreditList: [],
                form: {
                    nature: '个人',
                    agentType: '否',
                    attendState: '参加尚不确定'
                },
                attendStateList: [
                    {
                        value: '参加网络会议'
                    }, {
                        value: '参加现场会议'
                    }, {
                        value: '参加尚不确定'
                    }
                ],
                creditType: [
                    {
                        value: '个人'
                    }, {
                        value: '公司（机构）'
                    }, {
                        value: '行政机关（金融机构）'
                    }
                ],
                registerVisible: false,
                formLabelWidth: '150px',
            }
        },
        props: [
            'creditList',
            'caseId',
            'creditorId',
            'stateBoolean'
        ],
        mounted() {
            const _self = this;
            this.creditList.forEach(_credit => _self.showCreditList.push({
                creditId: _credit.id,
                creditNo: _credit.creditNo,
                typeText: _self.matchTypeText(_credit.type),
                /*stateText: _self.matchStateText(_credit.state,_credit.opType),*/
                state: _credit.state,
               /* showChange: _self.canChange(_credit.state)*/
            }))
        },
        methods: {
            /*creditDetail: function (row, column, cell, event) {
                if (row.state === 11)
                    this.toChange(row);
                else
                    this.toSure(row);
            },*/
            toMain: function () {
                window.location.href = '../main/main.html?' + 'caseId=' + this.caseId + '&&creditorId=' + this.creditorId;
            },
            /*toChange: function (row) {
                window.location.href = '../register/register-credit.html?' + 'caseId=' + this.caseId + '&&creditorId=' + this.creditorId + '&&creditId=' + row.creditId + '&&type=' + 'update';
            },
            toDismissal: function (row) {
                window.location.href = '../credit/dismissal.html?' + 'caseId=' + this.caseId + '&&creditorId=' + this.creditorId + '&&creditId=' + row.creditId;
            },*/
            toSure: function (row) {
                window.location.href = '../credit/credit.html?' + 'caseId=' + this.caseId + '&&creditorId=' + this.creditorId + '&&creditId=' + row.creditId;
            },
            /*toQuery: function (row) {
                this.toSure(row);
            },*/
            toUpdateCreditor: function () {
                const _self = this;
                util.ajax({
                    url: '/caseInfo/getCreditorInfo',
                    params: {creditorId: this.creditorId},
                    success: function (data) {
                        _self.form.nature = _self.matchNatureText(data.message.nature);
                        _self.form.agentType = data.message.agentType === 0 ? '否' : '是';
                        _self.form.attendState = _self.matchAttendStateText(data.message.attendState || 0);
                        _self.registerVisible = true
                    }
                })
            },
            toRegister: function () {
                window.location.href = '../register/register-creditor.html?' + 'caseId=' + this.caseId + '&&creditorId=' + this.creditorId + '&&nature=' + this.matchNature(this.form.nature) + '&&agentType=' + (this.form.agentType === '否' ? 0 : 1) + '&&attendState=' + this.matchAttendState(this.form.attendState);
            },
            /*matchStateText: function (state,opType) {
                let stateText = '';
                switch (state) {
                    case 0:
                        stateText = '管理人新增待提交';
                        break;
                    case 1:
                        if(opType === 1){
                            stateText = '予以确认';
                        }else{
                            stateText = '不予确认';
                        }
                        break;
                    case 2:
                        if(opType === 1){
                            stateText = '异议审核予以确认';
                        }else{
                            stateText = '异议审核不予确认';
                        }
                        break;
                    case 3:
                        if(opType === 1 ){
                            stateText = '法院裁判予以确认';
                        }else{
                            stateText = '法院裁判不予确认';
                        }
                        break;
                    case 11:
                        stateText = '待审核';
                        break;
                    case 12:
                        stateText = '审核中';
                        break;
                    case 13:
                        stateText = '审核中';
                        break;
                    case 14:
                        if(opType === 2){
                            stateText = '待您补正材料';
                        }else{
                            stateText = '初审结果待您确认';
                        }
                        break;
                    case 21:
                        stateText = '待异议审核';
                        break;
                    case 22:
                        stateText = '异议审核中';
                        break;
                    case 23:
                        stateText = '异议审核中';
                        break;
                    case 24:
                        stateText = '待您补正异议材料';
                    default:
                        break
                }
                return stateText
            },*/
            matchTypeText: function (type) {
                let typeText = '';
                switch (type) {
                    case 1:
                        typeText = '职工债权';
                        break;
                    case 2:
                        typeText = '普通债权';
                        break;
                    case 3:
                        typeText = '税收债权';
                        break;
                    case 4:
                        typeText = '优先债权';
                        break;
                    default:
                        break
                }
                return typeText
            },
            matchAttendStateText: function (type) {
                let typeText = '';
                switch (type) {
                    case 0:
                        typeText = '参加尚不确定';
                        break;
                    case 1:
                        typeText = '参加现场会议';
                        break;
                    case 2:
                        typeText = '参加网络会议';
                        break;
                    case 3:
                        typeText = '';
                        break;
                    default:
                        typeText = '参加尚不确定';
                        break;
                }
                return typeText
            },
            matchAttendState: function (text) {
                let type = 0;
                switch (text) {
                    case '参加尚不确定':
                        type = 0;
                        break;
                    case '参加现场会议':
                        type = 1;
                        break;
                    case '参加网络会议':
                        type = 2;
                        break;
                    case '':
                        type = 3;
                        break;
                    default:
                        type = 0;
                        break;
                }
                return type
            },
            matchNatureText: function (type) {
                let text = 0;
                switch (type) {
                    case 1:
                        text = '个人';
                        break;
                    case 2:
                        text = '公司（机构）';
                        break;
                    case 3:
                        text = '行政机关（金融机构）';
                        break;
                    default:
                        break
                }
                return text;
            },
            matchNature: function (text) {
                let type = 0;
                switch (text) {
                    case '个人':
                        type = 1;
                        break;
                    case '公司（机构）':
                        type = 2;
                        break;
                    case '行政机关（金融机构）':
                        type = 3;
                        break;
                    default:
                        break
                }
                return type
            },
            //; 1:修改; 3:查看
            /*canChange: function (state) {
                if (state === 11 || state === 21 || state === 24)
                    return 1;
                else
                    return 3;
            }*/
        },
    }
</script>
-->
